package obecto.event
{
	import flash.events.IEventDispatcher;
	
	/**
	 * In broadcast implementations of event-driven environments such as 
	 * Flex and Flash, an event is fully described through its event source 
	 * (or the object from which this event originates), and the name which 
	 * distinguishes the event from the other events originating from the 
	 * same source.  
	 */
	public class EventDescriptor
	{
		public var eventSource : IEventDispatcher;
		public var eventName : String;
		
		public static function create(eventSource : IEventDispatcher, eventName : String) : EventDescriptor
		{
			var result : EventDescriptor = new EventDescriptor();
			result.eventSource = eventSource;
			result.eventName = eventName;
			return result;
		}
		
		public function equals(target : EventDescriptor) : Boolean
		{
			return ((eventSource === target.eventSource) && (eventName == target.eventName)); 
		}
	}
}